package be.artesis.titamo.webservice;

public class DataLayerWebServiceProxy implements be.artesis.titamo.webservice.DataLayerWebService {
  private String _endpoint = null;
  private be.artesis.titamo.webservice.DataLayerWebService dataLayerWebService = null;
  
  public DataLayerWebServiceProxy() {
    _initDataLayerWebServiceProxy();
  }
  
  public DataLayerWebServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initDataLayerWebServiceProxy();
  }
  
  private void _initDataLayerWebServiceProxy() {
    try {
      dataLayerWebService = (new be.artesis.titamo.webservice.DataLayerWebServiceServiceLocator()).getDataLayerWebService();
      if (dataLayerWebService != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)dataLayerWebService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)dataLayerWebService)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (dataLayerWebService != null)
      ((javax.xml.rpc.Stub)dataLayerWebService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public be.artesis.titamo.webservice.DataLayerWebService getDataLayerWebService() {
    if (dataLayerWebService == null)
      _initDataLayerWebServiceProxy();
    return dataLayerWebService;
  }
  
  public be.artesis.titamo.io.TimeTableEntry[] getErrors() throws java.rmi.RemoteException{
    if (dataLayerWebService == null)
      _initDataLayerWebServiceProxy();
    return dataLayerWebService.getErrors();
  }
  
  public be.artesis.titamo.io.TimeTableEntry[] getRecordsByDocent(java.lang.String docent, java.lang.String dag) throws java.rmi.RemoteException{
    if (dataLayerWebService == null)
      _initDataLayerWebServiceProxy();
    return dataLayerWebService.getRecordsByDocent(docent, dag);
  }
  
  public be.artesis.titamo.io.TimeTableEntry[] getRecordsByKlas(java.lang.String klas, java.lang.String dag) throws java.rmi.RemoteException{
    if (dataLayerWebService == null)
      _initDataLayerWebServiceProxy();
    return dataLayerWebService.getRecordsByKlas(klas, dag);
  }
  
  public be.artesis.titamo.io.TimeTableEntry[] getRecordsByVak(java.lang.String vak, java.lang.String dag) throws java.rmi.RemoteException{
    if (dataLayerWebService == null)
      _initDataLayerWebServiceProxy();
    return dataLayerWebService.getRecordsByVak(vak, dag);
  }
  
  
}